/**
 * 
 */
package rentReturnController;

import java.io.IOException;
import java.net.URL;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.time.LocalDate;
import java.time.LocalTime;
import java.util.ArrayList;
import java.util.Random;
import java.util.ResourceBundle;

import pdf.PDFGenerator;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
import javafx.scene.control.ComboBox;
import javafx.scene.control.DatePicker;
import javafx.scene.control.Label;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
//import Vehicle.*;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Modality;
import javafx.stage.Stage;
import rentReturnEntity.RentEntity;
import rentReturnLogic.RentLogic;
import rentReturnService.RentService;
import reservationController.ReservationController;
import reservationEntity.ReservationEntity;
import reservationLogic.ReservationLogic;
import reservationService.ReservationService;
import userController.Navigator;
import validator.Validator;
import vehicleEntity.AvailableVehicleDisplayable;

/**
 * @author Aakash Singh
 *
 */
public class RentController implements Initializable {
	private static int sceneNumber=0;
	public static int getSceneNumber() {
		return sceneNumber;
	}

	public static void setSceneNumber(int sceneNumber) {
		RentController.sceneNumber = sceneNumber;
	}

	@FXML
	private Label vehicleSelect;
	@FXML
	private Button rent_RentWithReservation;
	@FXML
	private Button rent_RentWithoutReservation;
	@FXML
	private TextField reservationID;
	@FXML
	private TextField reservationPhoneNumber;
	@FXML
	private TextField reservationDate;
	@FXML
	private TextField rent_reservation_number;
	@FXML
	private Label rent_ErrorLabel;
	@FXML
	private TableView<String>rent_available_vehicle_list;
	@FXML
	private TextField rent_reservation_number_2;
	@FXML
	private TextField rent_reserved_vehicle_class;
	@FXML
	private TextField rent_reserved_date_time;
	@FXML
	private TextField rent_reserved_vehicle_type;
	@FXML
	TableColumn<AvailableVehicleDisplayable,Integer> VehicleID;
	@FXML
	TableColumn<AvailableVehicleDisplayable,String> VehicleType;
	@FXML
	TableColumn<AvailableVehicleDisplayable,String> VehicleClass;
	@FXML
	TableColumn<AvailableVehicleDisplayable,String> VehicleName;
	@FXML
	TableColumn<AvailableVehicleDisplayable,String> availableDate;



	@FXML
	private TextField rent_agreement_number;
	@FXML
	private TextField vehicle_current_odometer_reading;
	@FXML
	private Label genRentID;
	@FXML
	private TextArea vehicleCondition;
	@FXML
	private CheckBox rent_customer_credit_card_verified;
	@FXML
	private CheckBox rent_customer_driver_licence_verified;
	@FXML
	private Button backButton;
	@FXML
	private Button selectVehicleButton;
	@FXML
	private Button rent_finalize_rent;
	@FXML
	private TextField rentedVehicleSpec;
	@FXML
	private TextField rentedAdditionalEquipment;
	@FXML
	private TextField rentedVehicleID;
	@FXML
	private TextField return_date_time;
	@FXML
	private TextField rent_customer_phone_Number;
	@FXML
	private DatePicker rent_pickup_date;
	@FXML
	AnchorPane dialogAnchor;
	@FXML
	private Button okButton;
	@FXML
	private Button noButton;
	@FXML
	private ComboBox<String> otherChoices;


	@FXML
	TableView<AvailableVehicleDisplayable> availableVehicleTable;

	@FXML
	private Label selectedvehicleID;

	@FXML
	private Label reservID;

	private static RentEntity rentEntity = null;
	private static RentLogic rentLogic = null;
	private static ReservationEntity reservationEntity = null;
	private static RentService rentService = null;
	private static ReservationService reservationService = null;
	private static Boolean rent_with_reserve=false;

	/**
	 * This method invokes the Initial Rent Page which would give an option to 
	 * either do "Rent with Reservation" or "Rent without Reservation"
	 */
	public void doRent(){
		// load rent frame
		sceneNumber = 1; 
		Navigator.loadStackPane(Navigator.RentInitialScreenFXML);
	}

	/**
	 * This method is an Event Handler of a button the Initial Rent Page to do Rent Without Reservation
	 * 
	 * @param event
	 */
	@FXML
	public void rentWithoutReservation(ActionEvent event){
		sceneNumber=6;
		rent_with_reserve=false;
		ReservationController.setPage(-1);
		Navigator.loadStackPane(Navigator.ClerkReservationInitialFXML);
	}

	/**
	 * This method is an Event Handler of a button the Initial Rent Page to do Rent With Reservation
	 * @param event
	 */
	@FXML
	public void rentWithReservation(ActionEvent event){
		sceneNumber = 2;
		rent_with_reserve=true;
		Navigator.loadStackPane(Navigator.RentwithReservationInitialScreenFXML);
		// load search screen
	}

	/**
	 * This method is an Event handler for a button on the Initial Reservation Page of rent with 
	 * reservation which will search the database for entry corresponding to a particular reservation Id
	 * @param event
	 * @pre The inputs from the user are validated
	 * @post The reservation corresponding reservationId is shown or 
	 * an appropriate error message is shown
	 *
	 */
	@FXML
	public void searchReservation(ActionEvent event){
		// Reservation manager.validate reservation id
		// reservation manager. fetchReservation
		// show reservation details
		try
		{
			long rent_ReservationID = 0;
			rent_ErrorLabel.setVisible(false);
			String reservedVehicleType = null;
			ResultSet reservationResultSet = null; 
			ResultSet rentResultSet = null;
			if(!rent_reservation_number.getText().isEmpty())
				if(Validator.validateStringContainsInteger(rent_reservation_number.getText().trim()))
				{

					rent_ReservationID = new Long(rent_reservation_number.getText().trim());
					reservationService = new ReservationService();
					ArrayList<String> additionalEquip = new ArrayList<String>();
					reservationResultSet = reservationService.fetchReservation(rent_ReservationID);
					if(reservationResultSet != null && reservationResultSet.next()){
						System.out.println("Inside if");
						reservationEntity = new ReservationEntity();
						do
						{
							System.out.println("inside do");
							reservationEntity.setReservationID(reservationResultSet.getInt("reservationID"));
							reservationEntity.setVehicleClass(reservationResultSet.getString("vehicleClass"));
							reservationEntity.setVehicleSpec(reservationResultSet.getString("vehicleSpec"));

							//reservationEntity.setAdditionalEquip(reservationResultSet.getString("equipmentName"));
							reservationEntity.setPhoneNumber(reservationResultSet.getString(2));
							reservedVehicleType = reservationResultSet.getString("vehicleType");
							reservationEntity.setVehicleType(reservedVehicleType);
							System.out.println("Reservaed vehicle type + " + reservedVehicleType);
							reservationEntity.setReturnDate(LocalDate.parse(reservationResultSet.getDate("returnDate").toString()));
							reservationEntity.setReturnTime(reservationResultSet.getTime("returnTime").toString());
							System.out.println(reservationEntity.getReturnTime());
							additionalEquip.add(reservationResultSet.getString("equipmentName"));
							if(reservationResultSet.wasNull())
							{
								additionalEquip=null;
								break;
							}
						}while(reservationResultSet.next());
						reservationEntity.setAdditionalEquip(additionalEquip);
						reservationService.closeConnection();
						sceneNumber = 3;

						Navigator.loadStackPane(Navigator.RentSelectVehicleScreenFXML);

					}else{
						rent_ErrorLabel.setText(" No record found , please try again ");
						rent_ErrorLabel.setVisible(true);
						return;
					}

				}else{
					rent_ErrorLabel.setText(" Fields should contain only Numbers");
					rent_ErrorLabel.setVisible(true);
					return;
				}
			else if(!rent_customer_phone_Number.getText().isEmpty() && rent_pickup_date.getValue()!=null)
			{

				if(rent_customer_phone_Number.getText().length()!=10 || !Validator.validatePhoneNumber(rent_customer_phone_Number.getText()))
				{
					rent_ErrorLabel.setText("Please enter a valid phone number");
					rent_ErrorLabel.setVisible(true);
					return;
				}
				if(!Validator.validateFutureDate(rent_pickup_date.getValue()))
				{
					rent_ErrorLabel.setText("Please enter a present or future Pickup Date");
					rent_ErrorLabel.setVisible(true);
					return;
				}
				reservationService = new ReservationService();
				ArrayList<String> additionalEquip = new ArrayList<String>();
				reservationResultSet = reservationService.fetchReservation(rent_customer_phone_Number.getText(),rent_pickup_date.getValue().toString());
				if(reservationResultSet != null && reservationResultSet.next()){
					reservationEntity = new ReservationEntity();
					do
					{
						reservationEntity.setReservationID(reservationResultSet.getInt("reservationID"));
						reservationEntity.setVehicleClass(reservationResultSet.getString("vehicleClass"));
						reservationEntity.setVehicleSpec(reservationResultSet.getString("vehicleSpec"));
						//reservationEntity.setAdditionalEquip(reservationResultSet.getString("equipmentName"));
						additionalEquip.add(reservationResultSet.getString("equipmentName"));
						
						reservationEntity.setPhoneNumber(reservationResultSet.getString(2));
						reservedVehicleType = reservationResultSet.getString("vehicleType");
						reservationEntity.setVehicleType(reservedVehicleType);
						reservationEntity.setReturnDate(LocalDate.parse(reservationResultSet.getDate("returnDate").toString()));
						reservationEntity.setReturnTime(reservationResultSet.getTime("returnTime").toString());
						if(reservationResultSet.wasNull())
						{
							additionalEquip=null;
							break;
						}
					}while(reservationResultSet.next());
					reservationEntity.setAdditionalEquip(additionalEquip);
					reservationService.closeConnection();
					sceneNumber = 3;

					Navigator.loadStackPane(Navigator.RentSelectVehicleScreenFXML);

				}else{
					rent_ErrorLabel.setText(" No record found , please try again ");
					rent_ErrorLabel.setVisible(true);
					return;
				}
			}
			else
			{
				rent_ErrorLabel.setText("Please Enter the required values ");
				rent_ErrorLabel.setVisible(true);
			}
		}
		catch(SQLException sq)
		{
			sq.printStackTrace();
		}
	}
	static int showAgain=0;


	public void fetchOverdueVehicles()
	{
		ObservableList<AvailableVehicleDisplayable> availableVehicleList= FXCollections.observableArrayList();
		RentLogic rl = new RentLogic();
		VehicleID.setMinWidth(100);
		VehicleID.setCellValueFactory(new PropertyValueFactory<AvailableVehicleDisplayable, Integer>("vehicleId"));
		VehicleType.setCellValueFactory(new PropertyValueFactory<AvailableVehicleDisplayable, String>("vehicleType"));
		VehicleClass.setCellValueFactory(new PropertyValueFactory<AvailableVehicleDisplayable, String>("vehicleClass"));
		VehicleName.setCellValueFactory((new PropertyValueFactory<AvailableVehicleDisplayable, String>("vehicleName")));
		availableDate.setCellValueFactory((new PropertyValueFactory<AvailableVehicleDisplayable, String>("availableDate")));

		try {
			availableVehicleList=rl.fetchOverdueVehicles();
			System.out.println("Here we are "+availableVehicleList.size());
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}


		availableVehicleTable.setItems(availableVehicleList);



	}

	/**
	 * This is a method to fetch the vehicles with the given vehicleType
	 * @pre The vehicle type is taken from the vehicle type selected corresponding to the given reservation
	 * @post The list of vehicles is displayed pertaining to the availability of the particular vehicle type
	 * @param vehicleType
	 */
	public void fetchVehicle(String vehicleType){

		System.out.println("Inside fetchVehicles");
		rent_ErrorLabel.setVisible(false);
		RentLogic rl= new RentLogic();
		ObservableList<AvailableVehicleDisplayable> availableVehicleList= FXCollections.observableArrayList();

		VehicleID.setMinWidth(100);
		VehicleID.setCellValueFactory(new PropertyValueFactory<AvailableVehicleDisplayable, Integer>("vehicleId"));
		VehicleType.setCellValueFactory(new PropertyValueFactory<AvailableVehicleDisplayable, String>("vehicleType"));
		VehicleClass.setCellValueFactory(new PropertyValueFactory<AvailableVehicleDisplayable, String>("vehicleClass"));
		VehicleName.setCellValueFactory((new PropertyValueFactory<AvailableVehicleDisplayable, String>("vehicleName")));

		try {
			availableVehicleList=rl.fetchVehicle(vehicleType);
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		System.out.println(availableVehicleList.size());
		availableVehicleTable.setItems(availableVehicleList);
		otherChoices.getItems().clear();
		if(availableVehicleList.size()>0)
		{
			System.out.println("No of vehicle more than 0...... "+otherChoices.getItems().size());
			try {
				ReservationLogic rll = new ReservationLogic();
				otherChoices.getItems().clear();
				otherChoices.getItems().addAll(rll.fetchVehicleTypeRent(reservationEntity.getVehicleClass()));
				System.out.println("after clearing and entering "+otherChoices.getItems().size());

			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			rent_ErrorLabel.setVisible(false);
			backButton.setVisible(false);
			selectVehicleButton.setVisible(true);
		}
		else 
			if(availableVehicleList.size()==0)
			{
				System.out.println("vehicle is zero..... "+otherChoices.getItems().size());

				showAgain=1;
				vehicleSelect.setText("Select Vehicle Type :");
				rent_ErrorLabel.setText("No vehicle found available for the required reservations");
				rent_ErrorLabel.setVisible(true);
				backButton.setVisible(true);
				selectVehicleButton.setVisible(false);
				ReservationLogic rll = new ReservationLogic();
				try {
					otherChoices.getItems().clear();
					otherChoices.getItems().addAll(rll.fetchVehicleTypeRent(reservationEntity.getVehicleClass()));
					System.out.println("after clearing and entering "+otherChoices.getItems().size());

				} catch (SQLException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
				otherChoices.setVisible(true);

			}

	}


	@FXML
	public void changeVehicleType(ActionEvent event)
	{
		reservationEntity.setVehicleType(otherChoices.getValue());
		System.out.println("Selected vehicle is "+ reservationEntity.getVehicleType());
		fetchVehicle(reservationEntity.getVehicleType());

		System.out.println("in changed vehicle type..... "+otherChoices.getItems().size());

	}



	/**
	 * This method enables the user to go to the previous page incase no vehicles are currently available
	 * @param ae
	 */
	@FXML
	public void backButtonFunc(ActionEvent ae)
	{
		sceneNumber=10;
		Validator v= new Validator();
		v.dialogBox();


	}

	/**
	 * This is the Event handler of the button on the dialog box and navigate to appropriate page
	 * @param ae
	 */
	@FXML
	public void okPressed(ActionEvent ae)
	{
		System.err.println("Ok is pressed by the user");
		if(rent_with_reserve==true)
		{ 
			sceneNumber = 2;
			Navigator.loadStackPane(Navigator.RentwithReservationInitialScreenFXML);
		}
		else
		{
			ReservationController.setPage(0);
			Navigator.loadStackPane(Navigator.ReservationInitialFXML);
		}
		Validator v = new Validator();
		v.closeDialog();
	}

	/**
	 * This is an Event handler of the no button on the dialog box which will close the dialog box
	 * @param ae
	 */
	@FXML
	public void noPressed(ActionEvent ae)
	{
		Validator v = new Validator();
		v.closeDialog();
	}


	@FXML
	public void selectVehicle(ActionEvent event){
		// load the rent details frame
		rent_ErrorLabel.setVisible(false);
		ObservableList<AvailableVehicleDisplayable> selection = 
				availableVehicleTable.getSelectionModel().getSelectedItems();
		int i=0;
		while(i<selection.size())
		{
			rentEntity = new RentEntity();
			rentEntity.setVehicleId(selection.get(i).getVehicleId());
			i++;}
		if(selection.size()==0)
		{
			rent_ErrorLabel.setText("Please select a vehicle to proceed");
			rent_ErrorLabel.setVisible(true);
			return;
		}
		sceneNumber = 4;
		Navigator.loadStackPane(Navigator.RentFinalizeReservationScreenFXML);
	}

	@FXML
	public void rentVehicle(ActionEvent event){

	}

	@FXML
	public void generateRentalAgreement(ActionEvent event){
		RentLogic rent = new RentLogic();
		rent_ErrorLabel.setVisible(false);
		if((rent_customer_credit_card_verified.selectedProperty().getValue()) && (rent_customer_driver_licence_verified.selectedProperty().getValue()) && !vehicle_current_odometer_reading.getText().isEmpty() && !vehicleCondition.getText().isEmpty())
		{		
			if(!Validator.validateStringContainsInteger(vehicle_current_odometer_reading.getText()))
			{
				rent_ErrorLabel.setText("Please enter a valid Vehicle Current Odometer reading");
				rent_ErrorLabel.setVisible(true);
				return;
			}

			rent_finalize_rent.setDisable(false);
			Random randomGenerator = new Random();
			rentEntity.setRentAgreementNumber(randomGenerator.nextInt(1000));
			if(reservationEntity != null ){
				RentLogic logic = new RentLogic();
				String name = logic.fetchUserName(reservationEntity.getPhoneNumber());
				if(!name.equalsIgnoreCase("")){
					System.out.println(rentEntity.getRentAgreementNumber());
					System.out.println(name);
					System.out.println(reservationEntity.getVehicleType());
					System.out.println(rentEntity.getVehicleId() );
					System.out.println(reservationEntity.getReturnDate().toString());
					
					PDFGenerator.generateRentalAgreement(rentEntity.getRentAgreementNumber(),name, reservationEntity.getVehicleType(), rentEntity.getVehicleId(), reservationEntity.getReturnDate().toString());
				}
			}
			
		}
		else
		{
			rent_ErrorLabel.setText("Please enter all the required Values");
			rent_ErrorLabel.setVisible(true);
			return;
		}

		if(rent_customer_driver_licence_verified.selectedProperty().getValue()==false)
		{
			rent_ErrorLabel.setText("Please verify the Driving Licence");
			rent_ErrorLabel.setVisible(true);
			return;
		}
		else if(rent_customer_credit_card_verified.selectedProperty().getValue()==false)
		{
			rent_ErrorLabel.setText("Please verify the Credit Card Details");
			rent_ErrorLabel.setVisible(true);
			return;
		}
	}
	/** This method is an Event handler of a button on the finalize Rent page 
	 * This method will finalize the rent and make an appropriate the enteries in the database 
	 * and mark the corresponding vehicle as rented 
	 * @pre All the user inputs are valid
	 * @post Rent Id is displayed on the screen
	 * 
	 * @param event
	 */
	@FXML
	public void finalizeRent(ActionEvent event){

		RentLogic rent = new RentLogic();
		rent_ErrorLabel.setVisible(false);
		if((rent_customer_credit_card_verified.selectedProperty().getValue()) && (rent_customer_driver_licence_verified.selectedProperty().getValue()) && !vehicle_current_odometer_reading.getText().isEmpty() && !vehicleCondition.getText().isEmpty())
		{		
			/*if(!Validator.validateStringContainsInteger(rent_agreement_number.getText()))
		{
			rent_ErrorLabel.setText("Please enter a valid Rent Agreement Number");
			rent_ErrorLabel.setVisible(true);
			return;
		}*/
			if(!Validator.validateStringContainsInteger(vehicle_current_odometer_reading.getText()))
			{
				rent_ErrorLabel.setText("Please enter a valid Vehicle Current Odometer reading");
				rent_ErrorLabel.setVisible(true);
				return;
			}

			rentEntity.setAgeCheck(1);
			rentEntity.setCreditCheck(1);
			rentEntity.setOdometerReading(Integer.parseInt(vehicle_current_odometer_reading.getText()));
			//rentEntity.setRentAgreementNumber(Long.parseLong(rent_agreement_number.getText()));

			rentEntity.setRentDate(LocalDate.now());
			rentEntity.setRentTime(LocalTime.now().toString().substring(0, LocalTime.now().toString().length()-7));
			rentEntity.setReserveId(reservationEntity.getReservationID());
			rentEntity.setVehicleCondition(vehicleCondition.getText().toString());

			int rentID=0;
			try {
				rentID = rent.saveRent(rentEntity,reservationEntity.getReturnDate());
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			if(rentID==0)
			{
				System.err.println("Rent ID is not generated successfully");
				return;
			}
			else
			{
				rentEntity.setRentId(rentID);

			}



			sceneNumber=5;
			Navigator.loadStackPane(Navigator.RentFinalScreenFXML);
		}
		else
		{
			rent_ErrorLabel.setText("Please enter all the required Values");
			rent_ErrorLabel.setVisible(true);
			return;
		}

		if(rent_customer_driver_licence_verified.selectedProperty().getValue()==false)
		{
			rent_ErrorLabel.setText("Please verify the Driving Licence");
			rent_ErrorLabel.setVisible(true);
			return;
		}
		else if(rent_customer_credit_card_verified.selectedProperty().getValue()==false)
		{
			rent_ErrorLabel.setText("Please verify the Credit Card Details");
			rent_ErrorLabel.setVisible(true);
			return;
		}
	}

	/**
	 * Initialize method of the Rent Controller Class
	 */
	@Override
	public void initialize(URL location, ResourceBundle resources) {
		// TODO Auto-generated method stub
		if(sceneNumber==2)
		{
			Validator.addTextLimiter(rent_reservation_number, 10);
			Validator.addTextLimiter(rent_customer_phone_Number, 10);

		}else
			if(sceneNumber==3){
				fetchVehicle(reservationEntity.getVehicleType());
				System.out.println(reservationEntity.getReservationID());
				rent_reservation_number_2.setText(String.valueOf(reservationEntity.getReservationID()));
				System.out.println(reservationEntity.getReturnTime());
				rent_reserved_date_time.setText(reservationEntity.getReturnDate()+" / "+reservationEntity.getReturnTime());
				System.out.println(reservationEntity.getVehicleClass());
				rent_reserved_vehicle_class.setText(reservationEntity.getVehicleClass());
				System.out.println(reservationEntity.getVehicleType());
				rent_reserved_vehicle_type.setText(reservationEntity.getVehicleType());

			} else if (sceneNumber==4)
			{

				reservID.setText(""+reservationEntity.getReservationID());
				selectedvehicleID.setText(""+rentEntity.getVehicleId());
				//Validator.addTextLimiter(rent_agreement_number, 10);
				Validator.addTextLimiter(vehicle_current_odometer_reading, 7);
			}
			else if (sceneNumber==5)
			{
				genRentID.setText(""+rentEntity.getRentId());
				reservationPhoneNumber.setText(reservationEntity.getPhoneNumber());
				rent_reserved_date_time.setText(rentEntity.getRentDate().toString()+" / "+rentEntity.getRentTime());
				return_date_time.setText(reservationEntity.getReturnDate().toString()+" / "+reservationEntity.getReturnTime().substring(0, reservationEntity.getReturnTime().length()-3));
				rent_reserved_vehicle_type.setText(reservationEntity.getVehicleType());
				rentedVehicleID.setText(rentEntity.getVehicleId()+"");
				rent_reserved_vehicle_class.setText(reservationEntity.getVehicleClass());
				vehicle_current_odometer_reading.setText(rentEntity.getOdometerReading()+"");
				//rentedAdditionalEquipment.setText(reservationEntity.getAdditionalEquip());

				if(reservationEntity.getAdditionalEquip()==null)
				{
					rentedAdditionalEquipment.setText("None");
				}
				else
					if(reservationEntity.getAdditionalEquip().size()==2)
					{
						rentedAdditionalEquipment.setText(reservationEntity.getAdditionalEquip().get(0)+" + "+reservationEntity.getAdditionalEquip().get(1));

					}else if (reservationEntity.getAdditionalEquip().size()==1)
					{
						rentedAdditionalEquipment.setText(reservationEntity.getAdditionalEquip().get(0));
					}
					else
					{
						System.out.println("NONE OF THE SITUATIONS");
					}
				rentedVehicleSpec.setText(reservationEntity.getVehicleSpec());

				sceneNumber=0; 
			}
			else if (sceneNumber==7)
			{
				fetchOverdueVehicles();

			}
	}

	public static ReservationEntity getReservationEntity() {
		return reservationEntity;
	}

	public static void setReservationEntity(ReservationEntity reservationEntity) {
		RentController.reservationEntity = reservationEntity;
	}
}
